package com.xhtech.base.service

import com.yxh.lib_base.ext.lazyNone

/**
 * @author yuanxh
 * @date :2023/6/20 7:58
 * @description:
 */
class AppService : IAppService by proxy ,IAppRouterService by mRouterProxy{

    companion object {
        private val service by lazyNone { AppService() }
        private var proxy: IAppService = object : IAppService {}
        private var mRouterProxy: IAppRouterService = object : IAppRouterService {}

        fun initProxy(proxy: IAppService, routerService: IAppRouterService? = null) {
            this.proxy = proxy
            routerService?.let {
                mRouterProxy = it
            }
        }

        fun get() = service
    }
}